import request from '/@/utils/request';

export function fileApi() {
	return {
		submit: (data: object) => {
			return request({
				method: 'post',
				url: 'file/submit',
				data,
			});
		},
		delete: (id: any) => {
			return request({
				method: 'delete',
				url: `file/delete/${id}`,
			});
		},
		batchDelete: (data: object) => {
			return request({
				method: 'post',
				url: 'file/batchdel',
				data,
			});
		},
		search: (data: object) => {
			return request({
				method: 'post',
				url: 'file/search',
				data,
			});
		},
		craete_catalog: (data: object) => {
			return request({
				url: 'file/catalog/create',
				method: 'post',
				data,
			});
		},
		update_catalog: (data: object) => {
			return request({
				url: 'file/catalog/update',
				method: 'put',
				data,
			});
		},
		delete_catalog: (id: any) => {
			return request({
				url: `file/catalog/delete/${id}`,
				method: 'delete',
			});
		},
		view_catalog: (id: any) => {
			return request({
				url: `file/catalog/view/${id}`,
				method: 'get',
			});
		},
		tree_catalog: () => {
			return request({
				url: 'file/catalog/tree',
				method: 'get',
			});
		},
	};
}
